/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliveryWxpayResult;
import org.apache.ibatis.jdbc.SQL;

public class DeliveryWxpayResultSqlProvider {

    /* @mbggenerated */
    public String insertSelective(DeliveryWxpayResult record) {
        return new SQL() {
            {
                INSERT_INTO("delivery_wxpay_result");

                if (record.getAppid() != null) {
                    VALUES("appid", "#{appid,jdbcType=VARCHAR}");
                }

                if (record.getBankType() != null) {
                    VALUES("bank_type", "#{bankType,jdbcType=VARCHAR}");
                }

                if (record.getCashFee() != null) {
                    VALUES("cash_fee", "#{cashFee,jdbcType=VARCHAR}");
                }

                if (record.getFeeType() != null) {
                    VALUES("fee_type", "#{feeType,jdbcType=VARCHAR}");
                }

                if (record.getIsSubscribe() != null) {
                    VALUES("is_subscribe", "#{isSubscribe,jdbcType=VARCHAR}");
                }

                if (record.getMchId() != null) {
                    VALUES("mch_id", "#{mchId,jdbcType=VARCHAR}");
                }

                if (record.getNonceStr() != null) {
                    VALUES("nonce_str", "#{nonceStr,jdbcType=VARCHAR}");
                }

                if (record.getOpenid() != null) {
                    VALUES("openid", "#{openid,jdbcType=VARCHAR}");
                }

                if (record.getOutTradeNo() != null) {
                    VALUES("out_trade_no", "#{outTradeNo,jdbcType=VARCHAR}");
                }

                if (record.getResultCode() != null) {
                    VALUES("result_code", "#{resultCode,jdbcType=VARCHAR}");
                }

                if (record.getReturnCode() != null) {
                    VALUES("return_code", "#{returnCode,jdbcType=VARCHAR}");
                }

                if (record.getSign() != null) {
                    VALUES("sign", "#{sign,jdbcType=VARCHAR}");
                }

                if (record.getTimeEnd() != null) {
                    VALUES("time_end", "#{timeEnd,jdbcType=VARCHAR}");
                }

                if (record.getTotalFee() != null) {
                    VALUES("total_fee", "#{totalFee,jdbcType=VARCHAR}");
                }

                if (record.getTradeType() != null) {
                    VALUES("trade_type", "#{tradeType,jdbcType=VARCHAR}");
                }

                if (record.getTransactionId() != null) {
                    VALUES("transaction_id", "#{transactionId,jdbcType=VARCHAR}");
                }

            }
        }.toString();
    }

    /* @mbggenerated */
    public String updateByPrimaryKeySelective(DeliveryWxpayResult record) {
        return new SQL() {
            {
                UPDATE("delivery_wxpay_result");

                if (record.getAppid() != null) {
                    SET("appid = #{appid,jdbcType=VARCHAR}");
                }

                if (record.getBankType() != null) {
                    SET("bank_type = #{bankType,jdbcType=VARCHAR}");
                }

                if (record.getCashFee() != null) {
                    SET("cash_fee = #{cashFee,jdbcType=VARCHAR}");
                }

                if (record.getFeeType() != null) {
                    SET("fee_type = #{feeType,jdbcType=VARCHAR}");
                }

                if (record.getIsSubscribe() != null) {
                    SET("is_subscribe = #{isSubscribe,jdbcType=VARCHAR}");
                }

                if (record.getMchId() != null) {
                    SET("mch_id = #{mchId,jdbcType=VARCHAR}");
                }

                if (record.getNonceStr() != null) {
                    SET("nonce_str = #{nonceStr,jdbcType=VARCHAR}");
                }

                if (record.getOpenid() != null) {
                    SET("openid = #{openid,jdbcType=VARCHAR}");
                }

                if (record.getOutTradeNo() != null) {
                    SET("out_trade_no = #{outTradeNo,jdbcType=VARCHAR}");
                }

                if (record.getResultCode() != null) {
                    SET("result_code = #{resultCode,jdbcType=VARCHAR}");
                }

                if (record.getReturnCode() != null) {
                    SET("return_code = #{returnCode,jdbcType=VARCHAR}");
                }

                if (record.getSign() != null) {
                    SET("sign = #{sign,jdbcType=VARCHAR}");
                }

                if (record.getTimeEnd() != null) {
                    SET("time_end = #{timeEnd,jdbcType=VARCHAR}");
                }

                if (record.getTotalFee() != null) {
                    SET("total_fee = #{totalFee,jdbcType=VARCHAR}");
                }

                if (record.getTradeType() != null) {
                    SET("trade_type = #{tradeType,jdbcType=VARCHAR}");
                }

                if (record.getTransactionId() != null) {
                    SET("transaction_id = #{transactionId,jdbcType=VARCHAR}");
                }

                WHERE("id = #{id,jdbcType=INTEGER}");

            }
        }.toString();
    }
}